<?php

class Test_Query_model extends CI_Model {

	function __construct()
	{
		parent::__construct();
    }
    
    function test_query()
    {
    	return $this->db->query("SELECT * FROM test");    	
    }
    
    function test_num_rows()
    {
    	return $this->db->query("SELECT * FROM test")->num_rows();    	
    }
    
    function test_num_fields()
    {
    	return $this->db->query("SELECT * FROM test")->num_fields();    	
    }

    function test_result_object()
    {
    	return $this->db->query("SELECT * FROM test")->result_object();    	
    }

    function test_result_array()
    {
    	return $this->db->query("SELECT * FROM test")->result_array();    	
    }
    
    function test_row($n = 0)
    {
    	if ($n) {
    		return $this->db->query("SELECT * FROM test")->row($n);
    	} else {
    		return $this->db->query("SELECT * FROM test")->row();
    	}
    }

    function test_free_result()
    {
    	// @todo this needs more work potentially
    	return $this->db->query("SELECT * FROM test")->free_result();    	
    } 

}